home *** CD-ROM | disk | FTP | other *** search
/ Champak 125 / Vol 125 (Damaged).iso / interfac / mod.000 / scripts / __Packages / mx / controls / RadioButtonGroup.as < prev    next >
Encoding:
Text File  |  2009-06-06  |  5.6 KB  |  235 lines

  1. class mx.controls.RadioButtonGroup
  2. {
  3.    var radioList;
  4.    var __groupName;
  5.    var selectedRadio;
  6.    static var symbolName = "RadioButtonGroup";
  7.    static var symbolOwner = mx.controls.RadioButtonGroup;
  8.    static var version = "2.0.2.126";
  9.    var className = "RadioButtonGroup";
  10.    var indexNumber = 0;
  11.    function RadioButtonGroup()
  12.    {
  13.       this.init();
  14.       mx.events.UIEventDispatcher.initialize(this);
  15.    }
  16.    function init(Void)
  17.    {
  18.       this.radioList = new Array();
  19.    }
  20.    function setGroupName(groupName)
  21.    {
  22.       if(groupName == undefined || groupName == "")
  23.       {
  24.          return undefined;
  25.       }
  26.       var _loc6_ = this.__groupName;
  27.       _parent[groupName] = this;
  28.       for(var _loc5_ in this.radioList)
  29.       {
  30.          this.radioList[_loc5_].groupName = groupName;
  31.          var _loc3_ = this.radioList[_loc5_];
  32.       }
  33.       _loc3_.deleteGroupObj(_loc6_);
  34.    }
  35.    function getGroupName()
  36.    {
  37.       return this.__groupName;
  38.    }
  39.    function addInstance(instance)
  40.    {
  41.       instance.indexNumber = this.indexNumber++;
  42.       this.radioList.push(instance);
  43.    }
  44.    function getValue()
  45.    {
  46.       if(this.selectedRadio.data == "")
  47.       {
  48.          return this.selectedRadio.label;
  49.       }
  50.       return this.selectedRadio.__data;
  51.    }
  52.    function getLabelPlacement()
  53.    {
  54.       for(var _loc3_ in this.radioList)
  55.       {
  56.          var _loc2_ = this.radioList[_loc3_].getLabelPlacement();
  57.       }
  58.       return _loc2_;
  59.    }
  60.    function setLabelPlacement(pos)
  61.    {
  62.       for(var _loc3_ in this.radioList)
  63.       {
  64.          this.radioList[_loc3_].setLabelPlacement(pos);
  65.       }
  66.    }
  67.    function setEnabled(val)
  68.    {
  69.       for(var _loc3_ in this.radioList)
  70.       {
  71.          this.radioList[_loc3_].enabled = val;
  72.       }
  73.    }
  74.    function setSize(val, val1)
  75.    {
  76.       for(var _loc3_ in this.radioList)
  77.       {
  78.          this.radioList[_loc3_].setSize(val,val1);
  79.       }
  80.    }
  81.    function getEnabled()
  82.    {
  83.       for(var _loc4_ in this.radioList)
  84.       {
  85.          var _loc2_ = this.radioList[_loc4_].enabled;
  86.          var _loc3_ = t + (_loc2_ + 0);
  87.       }
  88.       if(_loc3_ == this.radioList.length)
  89.       {
  90.          return true;
  91.       }
  92.       if(_loc3_ == 0)
  93.       {
  94.          return false;
  95.       }
  96.    }
  97.    function setStyle(name, val)
  98.    {
  99.       for(var _loc4_ in this.radioList)
  100.       {
  101.          this.radioList[_loc4_].setStyle(name,val);
  102.       }
  103.    }
  104.    function setInstance(val)
  105.    {
  106.       for(var _loc3_ in this.radioList)
  107.       {
  108.          if(this.radioList[_loc3_] == val)
  109.          {
  110.             this.radioList[_loc3_].selected = true;
  111.          }
  112.       }
  113.    }
  114.    function getInstance()
  115.    {
  116.       return this.selectedRadio;
  117.    }
  118.    function setValue(val)
  119.    {
  120.       for(var _loc4_ in this.radioList)
  121.       {
  122.          if(this.radioList[_loc4_].__data == val || this.radioList[_loc4_].label == val)
  123.          {
  124.             var _loc2_ = _loc4_;
  125.             break;
  126.          }
  127.       }
  128.       if(_loc2_ != undefined)
  129.       {
  130.          this.selectedRadio.setState(false);
  131.          this.selectedRadio.hitArea_mc._height = this.selectedRadio.__height;
  132.          this.selectedRadio.hitArea_mc._width = this.selectedRadio.__width;
  133.          this.selectedRadio = this.radioList[_loc2_];
  134.          this.selectedRadio.setState(true);
  135.          this.selectedRadio.hitArea_mc._height = this.selectedRadio.hitArea_mc._width = 0;
  136.       }
  137.    }
  138.    function set groupName(groupName)
  139.    {
  140.       if(groupName == undefined || groupName == "")
  141.       {
  142.          return;
  143.       }
  144.       var _loc6_ = this.__groupName;
  145.       _parent[groupName] = this;
  146.       for(var _loc5_ in this.radioList)
  147.       {
  148.          this.radioList[_loc5_].groupName = groupName;
  149.          var _loc3_ = this.radioList[_loc5_];
  150.       }
  151.       _loc3_.deleteGroupObj(_loc6_);
  152.    }
  153.    function get groupName()
  154.    {
  155.       return this.__groupName;
  156.    }
  157.    function set selectedData(val)
  158.    {
  159.       for(var _loc4_ in this.radioList)
  160.       {
  161.          if(this.radioList[_loc4_].__data == val || this.radioList[_loc4_].label == val)
  162.          {
  163.             var _loc2_ = _loc4_;
  164.             break;
  165.          }
  166.       }
  167.       if(_loc2_ != undefined)
  168.       {
  169.          this.selectedRadio.setState(false);
  170.          this.selectedRadio = this.radioList[_loc2_];
  171.          this.selectedRadio.setState(true);
  172.       }
  173.    }
  174.    function get selectedData()
  175.    {
  176.       if(this.selectedRadio.data == "" || this.selectedRadio.data == undefined)
  177.       {
  178.          return this.selectedRadio.label;
  179.       }
  180.       return this.selectedRadio.__data;
  181.    }
  182.    function get selection()
  183.    {
  184.       return this.selectedRadio;
  185.    }
  186.    function set selection(val)
  187.    {
  188.       for(var _loc3_ in this.radioList)
  189.       {
  190.          if(this.radioList[_loc3_] == val)
  191.          {
  192.             this.radioList[_loc3_].selected = true;
  193.          }
  194.       }
  195.    }
  196.    function set labelPlacement(pos)
  197.    {
  198.       for(var _loc3_ in this.radioList)
  199.       {
  200.          this.radioList[_loc3_].setLabelPlacement(pos);
  201.       }
  202.    }
  203.    function get labelPlacement()
  204.    {
  205.       for(var _loc3_ in this.radioList)
  206.       {
  207.          var _loc2_ = this.radioList[_loc3_].getLabelPlacement();
  208.       }
  209.       return _loc2_;
  210.    }
  211.    function set enabled(val)
  212.    {
  213.       for(var _loc3_ in this.radioList)
  214.       {
  215.          this.radioList[_loc3_].enabled = val;
  216.       }
  217.    }
  218.    function get enabled()
  219.    {
  220.       var _loc2_ = 0;
  221.       for(var _loc3_ in this.radioList)
  222.       {
  223.          _loc2_ += this.radioList[_loc3_].enabled;
  224.       }
  225.       if(_loc2_ == 0)
  226.       {
  227.          return false;
  228.       }
  229.       if(_loc2_ == this.radioList.length)
  230.       {
  231.          return true;
  232.       }
  233.    }
  234. }
  235.